const {
    spawn
} = require('child_process');
const ls = spawn('ls', ['-lh', '/user']);

ls.stdout.on('data', (data) => {
    console.log(`输出：${data}`);
});

ls.stderr.on('data', (data) => {
    console.log(`输出${data}`);
});

ls.on('close', (code) => {
    console.log(`错误码：${code}`);
})